package io.kimmking.dubbo.demo.second.provider.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.kimmking.dubbo.common.entity.Customer;
import io.kimmking.dubbo.common.mapper.CustomerMapper;
import io.kimmking.dubbo.common.service.CustomerService;
import org.apache.dubbo.config.annotation.DubboService;

/**
 * <p>
 *  服务实现类
 *  注意: Dubbo + mybatisplus结合下，供消费端消费的方法都需要在impl类里进行包装实现
 * </p>
 *
 * @author Kudu
 * @since 2021-08-03
 */
//@Service
@DubboService(version = "1.0.0", interfaceClass = CustomerService.class)
public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> implements CustomerService {

    @Override
    public Customer selectOneCustomer(String cName) {
        return this.getOne(Wrappers.lambdaQuery(Customer.class).eq(Customer::getCName,cName));
    }

}
